import grasp
'''
Created on Jun 11, 2012

@author: Nico
'''
import Parser
import manejoClusters as mc
import os
import copy
import grasp as GRASP #GRASP CTM

#path=raw_input('Ingresar direccion de .xls:') 
xls = os.path.join(os.getcwd(),'Formato_Calendario.xls')
table = Parser.ParseXLS(xls)
table_2 = copy.deepcopy(table)
clust = mc.generarHomogeneos(table)
clust2 = mc.generarHeterogeneos(table_2, clust)
clusters=clust+clust2

#Test de creacion de los clusters
i=0
print "Clusters homogeneos: \n"
for c in clust:
    print "Cluster "+str(i)+":"
    print c
    i=i+1
print "Clusters heterogeneos: \n"
for c in clust2:
    print "Cluster "+str(i)+":"
    print c
    i=i+1

#Test de creacion de patrones
pg=Parser.PatronGenerator()
pg.generarPatrones()
patrones=pg.patronesOut()
print "generar mods"
modulos = grasp.generarModulos()
print modulos
soln=[]
for _ in xrange(10):
    soln=grasp.graspear(table, patrones, modulos, clusters)
print "FIN"
